package com.uzhie.jt808.jt1078.entity.param8103;

import com.uzhie.jt808.JT808MsgBody;
import com.uzhie.jt808.msg.entity.MyBuffer;

/**
 * Created by zhangdequan on 2018/8/13.
 */
public class JT_8103_param_warn implements JT808MsgBody {

    //特殊报警录像存储阈值
    private byte warn_threshold_value;
    //特殊报警录像持续时间
    private byte warn_continued_time;
    //特殊报警标识起始时间
    private byte warn_begin_time;

    public byte getWarn_threshold_value() {
        return warn_threshold_value;
    }

    public void setWarn_threshold_value(byte warn_threshold_value) {
        this.warn_threshold_value = warn_threshold_value;
    }

    public byte getWarn_continued_time() {
        return warn_continued_time;
    }

    public void setWarn_continued_time(byte warn_continued_time) {
        this.warn_continued_time = warn_continued_time;
    }

    public byte getWarn_begin_time() {
        return warn_begin_time;
    }

    public void setWarn_begin_time(byte warn_begin_time) {
        this.warn_begin_time = warn_begin_time;
    }

    @Override
    public byte[] WriteToBytes() {
        MyBuffer buffer = new MyBuffer();
        buffer.put(getWarn_threshold_value());
        buffer.put(getWarn_continued_time());
        buffer.put(getWarn_begin_time());
        return buffer.array();
    }

    @Override
    public void ReadFromBytes(byte[] body) {
        MyBuffer buffer = new MyBuffer(body);
        setWarn_threshold_value(buffer.get());
        setWarn_continued_time(buffer.get());
        setWarn_begin_time(buffer.get());

    }
}
